var app = getApp()
// 语言
var util = require('../../utils/util.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    lists:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getLists();
  },
  getLists(){
    var that=this;
    let customer_id = wx.getStorageSync('customer_id')
    wx.request({
      url: app.globalData.urls + '/index/store-list',
      header: app.getPostRequestHeader(),
      method: 'POST',
      data: {
        open_id:customer_id.wx_openid
      },
      success: (res) => {
        if(res.data.code==200){
          that.setData({
            lists:res.data.data
          })
          console.log(res.data.data)
        }
      }
    })
  },
  // 去首页
  goindex(e){
    let item = e.currentTarget.dataset.item;
    wx.setStorageSync('shareId',item.bdmin_user_id)
    setTimeout(()=>{
      wx.switchTab({
        url: '/pages/index/index',
      })
    },0)
  },
})